﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>报修列表</title>
<link href="static/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="static/js/jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});
  
  //页面加载完成后排序
  reSort();
});

//默认优先显示未检测
var doFirst = false;

function reSort(){
	if(doFirst){
		//优先显示已检测
		$("#doNot_first").hide();
		$("#do_first").show();
		doFirst = false;
	}else{
		//优先显示未检测
		$("#doNot_first").show();
		$("#do_first").hide();
		doFirst = true;
	}
	
}
</script>
<script type="text/javascript">
$(function() {
	//jQuery提交  
	$("#del").click(function(){
		   if($("input[name='ids']:checked").length == 0){
			   alert("至少选择一条申请记录！");
			   return;
	}
		   
		   if($("input[after='true']:checked").length > 0){
			   alert("删除失败，存在记录已检测！");
			   return;
		   }
		   var gnl=confirm("确定要删除?");
		   if (gnl==true){
			 $("#repairApplicationDetailForm").submit(); 
		     return true;
		   }else{
		     return false;
		   }
	    // 
	}); 
});
</script>
<!-- 全选/全不选 -->
<script type="text/javascript">
   $(function() {
           $("#checkAll").click(function() {
                $('input[name="ids"]').attr("checked",this.checked); 
            });
            var $ids = $("input[name='ids']");
            $ids.click(function(){
                $("#checkAll").attr("checked",$ids.length == $("input[name='ids']:checked").length ? true : false);
            });
    });
 </script>

 <style type="text/css">  
 /*设置内容超出用省略号代替*/
 .tablelist {  
    table-layout: fixed;  
    width: 98% border:0px;  
    margin: 0px;  
} 
 .tablelist tr td {  
    text-overflow: ellipsis; /* for IE */  
    -moz-text-overflow: ellipsis; /* for Firefox,mozilla */  
    overflow: hidden;  
    white-space: nowrap;   
    text-align: left  
}  
 </style>
</head>


<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">数据表</a></li>
    <li><a href="#">基本内容</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
        <li><a href="RepairApplication_addPrompt.action" target="rightFrame"><span><img src="static/images/t01.png" /></span>添加</a></li>
        <li><a id="del"><span><img src="static/images/t03.png" /></span>删除</a></li>
        </ul>
        <!-- javascript:document.roleDetailForm.submit(); -->
    
    </div>
    
    
    <form id="repairApplicationDetailForm" name="repairApplicationDetailForm" action="RepairApplication_doBatchDelete.action" method="post">
    <table class="tablelist">
    	<thead>
    	<tr>
        <th style="width: 50px;"><input id="checkAll" name="" type="checkbox" value=""/></th>
        <th style="width: 50px;">编号</th>
        <th style="width: 120px;">部门名</th>       
        <th style="width: 120px;">实验室名</th>
        <th style="width: 70px;">设备编号</th>
        <th style="width: 100px;">报修人员</th>
        <th style="width: 200px;">申请日期</th>
        <th onclick="reSort()" style="width: 70px;">状态<i class="sort"><img src="static/images/px.gif" /></i></th>
        <th style="width: 200px;">故障现象说明</th>
        <!-- <th>操作</th> -->
        </tr>
        </thead>
        <!-- 优先显示未检测的tbody -->
        <tbody  id="doNot_first">
        <c:forEach items="${page.datas}" var="repair">
        <c:if test="${repair.status eq '未检测'}">
        <tr>
        <td><input name="ids" type="checkbox" value="${repair.id}" /></td>
        <td>${repair.id}</td>
        <td>${repair.deptName}</td>       
        <td>${repair.labName}</td>
        <td>${repair.equipId}</td>
        <td>${repair.techName}</td>
        <td>${repair.createDate}</td>
        <td>${repair.status}</td>
        <td>${repair.desc}</td>
       <!-- <td><a href="RepairApplication_updatePrompt.action?repairApplication.id=${repair.id}" class="tablelink">更新</a>   -->  
       	</td>
        </tr>
        </c:if>
        </c:forEach>
        
        <c:forEach items="${page.datas}" var="repair">
        <c:if test="${repair.status eq '已检测'}">
        <tr>
        <td><input name="ids" type="checkbox" after="true" value="${repair.id}" /></td>
        <td>${repair.id}</td>
        <td>${repair.deptName}</td>       
        <td>${repair.labName}</td>
        <td>${repair.equipId}</td>
        <td>${repair.techName}</td>
        <td>${repair.createDate}</td>
        <td>${repair.status}</td>
        <td>${repair.desc}</td>
        <!-- <td><a href="RepairApplication_updatePrompt.action?repairApplication.id=${repair.id}" class="tablelink">更新</a> -->    
       	</td>
        </tr>
        </c:if>
        </c:forEach>  
        </tbody>
        
        <!-- 优先显示已检测的tbody -->
        <tbody  id="do_first">
        <c:forEach items="${page.datas}" var="repair">
        <c:if test="${repair.status eq '已检测'}">
        <tr>
        <td><input name="ids" type="checkbox" value="${repair.id}" /></td>
        <td>${repair.id}</td>
        <td>${repair.deptName}</td>       
        <td>${repair.labName}</td>
        <td>${repair.equipId}</td>
        <td>${repair.techName}</td>
        <td>${repair.createDate}</td>
        <td>${repair.status}</td>
        <td>${repair.desc}</td>
        <!-- <td><a href="RepairApplication_updatePrompt.action?repairApplication.id=${repair.id}" class="tablelink">更新</a>  -->    
       	</td>
        </tr>
        </c:if>
        </c:forEach>
        
        <c:forEach items="${page.datas}" var="repair">
        <c:if test="${repair.status eq '未检测'}">
        <tr>
        <td><input name="ids" type="checkbox" value="${repair.id}" /></td>
        <td>${repair.id}</td>
        <td>${repair.deptName}</td>       
        <td>${repair.labName}</td>
        <td>${repair.equipId}</td>
        <td>${repair.techName}</td>
        <td>${repair.createDate}</td>
        <td>${repair.status}</td>
        <td>${repair.desc}</td>
        <!-- <td><a href="RepairApplication_updatePrompt.action?repairApplication.id=${repair.id}" class="tablelink">更新</a> -->    
       	</td>
        </tr>
        </c:if>
        </c:forEach>  
        </tbody>
    </table>
    </form>
    
   
     <div class="pagin">
    	<div class="message">共<i class="blue">${page.total}</i>条记录，当前显示第&nbsp;<i class="blue"><label>${page.pageNo}</label>&nbsp;</i>页</div>
		<ul class="paginList">
			<%@include file="/static/page/page.html" %>
		</ul>
    </div>  
    
    </div>
    
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>

</body>

</html>
